package com.engr.business.util;

import com.engr.business.consts.ResultCodesConstant;
import com.engr.business.vo.ResultVO;
import lombok.Getter;
import lombok.Setter;

/**
 * 公共响应类
 * @Auther: lyx
 * @Date: 2018-11-30
 */
@Getter
@Setter
public class ResultVoUtils {


	public static ResultVO success(Object data){
		return new ResultVO(ResultCodesConstant.SUCCESS, "SUCCESS", data);
	}

	public static ResultVO success(){
		return success("SUCCESS");
	}

	public static ResultVO error(){
		return error(ResultCodesConstant.ERROR, "ERROR");
	}

	public static ResultVO error(int code, String message){
		return new ResultVO(code, message, null);
	}

	public static ResultVO error(int code, String message, Object data) {
		return new ResultVO(code, message, data);
	}
	
}
